<script>
import authMixin from '@/mixins/auth'

export default {
	mixins: [authMixin],
	data() {
		return {
		}
	},
	methods: {
		async showTrade() {
			
			console.log(uni)
			let params = {}
			const {code, data} = await this.$api.common.getMenuSwitch(params)
			if(code === 200) {
				if(data.trade === 'close') {
					uni.setTabBarItem({
						index: 2,
						visible: false
					})
				}else {
					uni.setTabBarItem({
						index: 2,
						visible: true
					})
				}
			}
		}
	},
	onLaunch() {
		if(uni.getStorageSync('ChatAi-Token')) {
			if(this.$route.path == '/pages/login' || this.$route.path == '/pages/register') {
				this.$router.push('/pages/home/index')
			}
		}
	},
	created() {
		// console.log(123)
		// this.showTrade()
	}
}
</script>

<style lang="scss">
	@import '@/static/style/index.scss';
</style>
<style>
	.msgBox {
		width: 600rpx !important;
	}
</style>